Support ALTER MATERIALIZED VIEW ... SET PROPERTIES ...#9613
Support ALTER MATERIALIZED VIEW ... SET PROPERTIES ...#9613sopel39 merged 3 commits intotrinodb:masterfrom
Conversation
3557a83 to
cf37d85
Compare
lukasz-stec
left a comment
There was a problem hiding this comment.
Would be good to have high-level test like BaseConnectorTest.testRenameMaterializedView
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
|
Please base your PR on top of #9401 |
bd6a521 to
6c268c7
Compare
|
#9401 has been merged into master and I have rebased this PR onto master. |
c837fbc to
f495d80
Compare
core/trino-parser/src/main/java/io/trino/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/test/java/io/trino/sql/parser/TestSqlParser.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/security/AccessControl.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
30d5126 to
b97ad90
Compare
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/CreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
36331ed to
61b8681
Compare
electrum
left a comment
There was a problem hiding this comment.
There are some problems with the existing ALTER TABLE ... SET PROPERTIES that need to be resolved, so we need to hold off on this until that is done.
61b8681 to
bdfdfec
Compare
@electrum what problems do you mean? |
77ff9f3 to
f6b9ad6
Compare
1d1a6ba to
cd3beca
Compare
05d60cf to
6afac02
Compare
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
205d3e1 to
05c1100
Compare
sopel39
left a comment
There was a problem hiding this comment.
lgtm % comments. Previously you had tests for add XXX with (prop=DEFAULT) where you checked that it fails. I think these tests were valuable (now they should pass)
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
testing/trino-tests/src/test/java/io/trino/tests/TestMockConnector.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/execution/TestCreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
testing/trino-tests/src/test/java/io/trino/tests/TestMockConnector.java
Outdated
Show resolved
Hide resolved
05c1100 to
ae56504
Compare
ae56504 to
848b17a
Compare
848b17a to
c81a4ea
Compare
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractCatalogPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/Property.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/Property.java
Outdated
Show resolved
Hide resolved
c81a4ea to
5b4c667
Compare
core/trino-parser/src/main/java/io/trino/sql/tree/Property.java
Outdated
Show resolved
Hide resolved
This commit implements ALTER MATERIALIZED VIEW ... SET PROPERTIES... in the core engine. The implementation supports the use of a newly introduced SQL keyword "DEFAULT" on the right hand side of a property assignment. The support of the DEFAULT keyword is implemented by modifying certain classes related to properties in general (i.e. they are not specific to materialized view). Consequently, several other SQL statements also gain the support of the DEFAULT keyword "for free". They are: ALTER TABLE... ADD COLUMN... ANALYZE CREATE MATERIALIZED VIEW CREATE SCHEMA CREATE TABLE (both column properties and table properties) CREATE TABLE AS Note, however, that ALTER TABLE ... SET PROPERTIES ... is not in the list above. Support for DEFAULT in ALTER TABLE...SET PROPERTIES... requires extensive changes and will therefore be implemented in a subsequent commit.
There are two versions of AccessControl.checkCanCreateTable: the old deprecated version and the newer version which takes an additional Map<String, Object> parameter "properties"(so that the properties can be taken into account when making an access control decision). Which version is to be used should depend solely on the FeatureConfig parameter "disableSetPropertiesSecurityCheckForCreateDdl" - it should not depend on whether the "properties" parameter is empty.
This PR implements support for the ALTER MATERIALIZED VIEW ... SET PROPERTIES ... statement